package com.itheima.day05;

import java.util.LinkedList;

public class Demo2 {
    public static void main(String[] args) {
        LinkedList<String> queue = new LinkedList<String>();
        queue.addLast("1号");
        queue.addLast("2号");
        queue.addLast("3号");
        queue.offer("4号");


        System.out.println(queue.removeFirst());
        System.out.println(queue.removeFirst());
        System.out.println(queue.removeFirst());
        System.out.println(queue.poll());

        System.out.println("---------");
        LinkedList<String> stack=new LinkedList<String>();
        stack.addFirst("1子弹");
        stack.addFirst("2子弹");
        stack.addFirst("3子弹");
        stack.push("4子弹");
        System.out.println(stack.removeFirst());
        System.out.println(stack.removeFirst());
        System.out.println(stack.removeFirst());
        System.out.println(stack.pop());
    }

}
